<?php get_header(); ?>
    <?php get_sidebar(); ?>
        <div class="container">
        	
            <!--All Content Start-->
            <div class="content-wrapper">
            
            	<!--Feature Image-->
                <div class="feature-image">
                	<figure>
                    	<img src="<?php bloginfo('template_url'); ?>/images/upload/blog-feature-image1.jpg" alt="feature image" />
                    </figure>
                </div>
                <!--End-->
                
                <!--Page Title-->
                <div class="page-title sub single-page blog">
                	<div class="page-title-detail blog">
                    	<h1>Blog single with featured image</h1>
                        <nav class="page-navigation">
                            <ul>
                                <li><a href="index.html">home</a></li>
                                <li><a href="portfolio-single-slider-image.html">blog</a></li>
                                <li>Blog single with featured image</li>
                            </ul>
                        </nav>
                    </div>
                </div>
                <!--End-->
                
                <!--Body Content Start-->
                <section class="blog-wrapper">
                    <?php if(have_posts()): while(have_posts()): the_post(); ?>
                	<div class="blog-vertical">
                    	<div class="stripe">
                    
                            <!--Blog Meta-->
                            <nav class="blog-meta blog-single">
                                <span><i class="fa fa-clock-o"></i><a><?php the_date("d-m-Y"); ?></a></span>
                                <span><i class="fa fa-list-ul"></i><a href="#"><?php the_category(', '); ?></a></span>
                                <span class="last-meta"><i class="fa fa-user"></i><a href="#"><?php the_author(); ?></a></span>
                            </nav>
                            <!--End-->
                            
                            <p class="text-content">
                                <?php the_content(' '); ?>
                            </p>
                                
                            <!--Social Share Button-->
                            <div id="social-share">
                                <div id="shareme" class="sharrre" data-text="Gemiz Responsive HTML Template" data-url="<?php echo get_option('siteurl'); ?>">
                                <div class="box">
                                    <h4 class="share-this">Share This</h4>
                                    <a class="facebook" href="#">
                                        <img alt="facebook" src="<?php bloginfo('template_url'); ?>/images/social-media/top-social-media1.png" />
                                    </a>
                                    <a class="twitter" href="#">
                                        <img alt="tweet" src="<?php bloginfo('template_url'); ?>/images/social-media/top-social-media2.png" />
                                    </a>
                                </div>
                                </div>
                            </div>
                            <!--End-->
                                
                            <div class="clearfix"></div>
                                
                            <!--About Author Start-->
                            <div class="section-title-area">
                                <h2><span class="section-title">About author</span></h2>
                            </div>
                            <div class="author-detail">
                                <div class="author-image">
                                    <?php echo get_avatar(get_the_author_meta("id"), 75); ?>
                                </div>
                                <div class="author-text">
                                    <span class="section-title"><?php echo get_the_author_nickname(); ?></span>
                                    <p>
                                        <?php echo get_the_author_description(); ?>
                                    </p>
                                </div>
                            </div>
                            <!--About Author End-->
                            
                            <!--Related Post Start-->
                            <div class="section-title-area">
                                <h2><span class="section-title">Related post</span></h2>
                            </div>
                            
                            <ul class="related-post">
                                <?php
                                    $post_id = $post->ID;
                                    $categories = get_the_category($post_id);
                                    $tags = get_the_tags($post_id);
                                    
                                    $args=array(  
                                        'post__not_in' => array($post_id),
                                        'category__in' => $categories,
                                        'posts_per_page'=>4,
                                        'caller_get_posts'=>1  
                                    ); 
                                    
                                    $relatedPosts = new WP_Query($args);
                                    
                                    while($relatedPosts->have_posts()): $relatedPosts->the_post();
                                ?>
                                <li>
                                    <div class="related-post-thumb">
                                        <a href="blog-single.html">
                                            <div class="thumbnail-hover"></div>
                                            <img src="<?php bloginfo('template_url'); ?>/images/upload/related-post-thumbnail1.jpg" alt="related post" />
                                        </a>
                                    </div>
                                    <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
                                </li>
                                <?php endwhile; ?>
                                <?php wp_reset_postdata(); ?>
                            </ul>
                            <!--Related Post End-->
                            
                            <div class="clearfix"></div>
                            
                            <!--Comments Start-->
                            <?php comments_template(); ?>
                            <!--Leave a Comment End-->
                            
                        </div>
                    </div>
                    <?php endwhile; ?>
                    <?php else: ?>
                    <p>Sorry, There are no posts to display!</p>
                    <?php endif; ?>
                    <?php get_sidebar('left'); ?>
                    
                </section>
                <!--Body Content End-->
                
            </div>
            <!--All Content End-->
            
            <?php get_footer(); ?>
